package com.study.command;

/**
 * @Author tanglingyu
 * @Date: 2021/05/24/ 14:18
 * @Description
 */
public class TVOnCommand implements Command {

  // 聚合TVReceiver
  TVReceiver tv;

  // 构造器
  public TVOnCommand(TVReceiver tv) {
    super();
    this.tv = tv;
  }

  @Override
  public void execute() {
    // 调用接收者的方法
    tv.on();
  }

  @Override
  public void undo() {
    // 调用接收者的方法
    tv.off();
  }
}
